<template>
    <div class="home-panel"  >
        <div class="container" >
          <div class="head" >
            <h3 >最新专题<small ></small></h3>
            <a
              aria-current="page"
              href="#/"
              class="router-link-active router-link-exact-active xtx-more"
              data-v-d6f2c104=""
              
              ><span data-v-d6f2c104="">查看全部</span
              ><i class="iconfont icon-angle-right" data-v-d6f2c104=""></i
            ></a>
          </div>
          <div class="special-list" >
            <div class="special-item"   v-for="(item, index) in arr5" :key="index">
              <a
                aria-current="page"
                href="#/"
                class="router-link-active router-link-exact-active"
                
               
                ><img
                  :src="item.detailsUrl"
                  alt=""
                  
                />
                <div class="meta" >
                  <p class="title" >
                    <span class="top ellipsis" 
                      >{{item.title}}</span
                    ><span class="sub ellipsis" 
                      >{{item.summary}}</span
                    >
                  </p>
                  <span class="price" >¥{{item.lowestPrice}}起</span>
                </div></a
              >
              <div class="foot" >
                <span class="like" 
                  ><i class="iconfont icon-hart1" ></i
                  >{{item.replyNum}}</span
                ><span class="view" 
                  ><i class="iconfont icon-see" ></i>{{item.replyNum}}</span
                ><span class="reply" 
                  ><i class="iconfont icon-message" ></i
                  >{{item.replyNum}}</span
                >
              </div>
            </div>
           
           
          </div>
        </div>
      </div>
</template>

<script>
import axios from 'axios';
export default {
     data() {
      return {
      
        arr5: [],
      }
     },
     mounted() {
        var _this = this
        axios({
          url:'http://pcapi-xiaotuxian-front-devtest.itheima.net/home/special',
          mounted:'get'
        }).then(function(res){
          if (res.data.msg == "操作成功") {
            _this.arr5 = res.data.result;
          }
        })

    },
}
</script>

<style>
.box {
  display: flex;
  width: 100%;
  height: 345px;
  overflow: hidden;
  padding-bottom: 40px;
}
.box .list {
  width: 200%;
  display: flex;
  transition: all 1s;
}
.box .list li {
  margin-right: 10px;
  width: 240px;
}
.box .list li:nth-child(5n) {
  margin-right: 0;
}
.box .list li img {
  width: 240px;
  height: 305px;
}
.home-panel .head {
  padding: 40px 0;
  display: flex;
  align-items: flex-end;
}
.home-panel .head h3 {
  flex: 1;
  font-size: 32px;
  font-weight: 400;
  margin-left: 6px;
  height: 35px;
  line-height: 35px;
}
.home-panel .head h3 small {
margin-left: 20px;
font-size: 20px;
color: #ccc;
}
.special-list {
  height: 380px;
  padding-bottom: 20px;
  display: flex;
  justify-content: space-between;
}
.special-list .special-item {
  width: 404px;
  background: #fff;
  transition: all 0.5s;
}
.special-list .special-item:hover {
  transform: translate3d(0, -3px, 0);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}
.special-list .special-item a {
  display: block;
  width: 100%;
  height: 288px;
  position: relative;
}
.special-list .special-item a img {
  width: 100%;
  height: 100%;
  -o-object-fit: cover;
  object-fit: cover;
}
.special-list .special-item a .meta {
  background-image: linear-gradient(0deg, rgba(0, 0, 0, 0.8), transparent 50%);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 288px;
}
.special-list .special-item a .meta .title {
  position: absolute;
  bottom: 0;
  left: 0;
  padding-left: 16px;
  width: 70%;
  height: 70px;
}
.special-list .special-item a .meta .title .top {
  color: #fff;
  font-size: 22px;
  display: block;
}
.special-list .special-item a .meta .title .sub {
  display: block;
  font-size: 19px;
  color: #999;
}
.special-list .special-item a .meta .price {
  position: absolute;
  bottom: 25px;
  right: 16px;
  line-height: 1;
  padding: 4px 8px 4px 7px;
  color: #cf4444;
  font-size: 17px;
  background-color: #fff;
  border-radius: 2px;
}
.special-list .special-item .foot {
  height: 72px;
  line-height: 72px;
  padding: 0 20px;
  font-size: 16px;
}
.special-list .special-item .foot i {
  display: inline-block;
  width: 15px;
  height: 14px;
  margin-right: 5px;
  color: #999;
}
.special-list .special-item .foot .like,
.special-list .special-item .foot .view {
  float: left;
  margin-right: 25px;
  vertical-align: middle;
}
.special-list .special-item .foot .reply {
  float: right;
  vertical-align: middle;
}
.ellipsis{
  color: #999;
  font-size: 18px !important;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
</style>